//
//  TaskPool.h
//  Pitch
//
//  Created by zhujinhui on 14-9-11.
//  Copyright (c) 2014年 zhujinhui. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ServiceMediator.h"
#import "BaseViewController.h"

@protocol TaskPoolDelegate ;



@interface TaskPool : NSObject<ServiceMediatorDelegate>

@property (nonatomic    ,assign) id<TaskPoolDelegate> mDelegate;

@property (nonatomic, retain) BaseViewController *bindedController;


+(TaskPool *) shareInstance;

/**
 * do task
 */
-(NSString *) doTaskWithService:(NSString *)serviceName;

-(void)cancelcurrentTask;

@end


@protocol TaskPoolDelegate <NSObject>
@optional
-(void)taskPool:(TaskPool *)task serviceWithNameDidFinished:(NSString *)serviceName response:(NetworkResponse *)response;

@end
